# 定义一个类
class Singleton:
    __instance = None
    __has_init = None

    def __new__(cls, *args, **kwargs):
        if cls.__instance is None:
            cls.__instance = super().__new__(cls)
        return cls.__instance


    def __init__(self):
        if Singleton.__has_init:
            return

        print("执行初始化")
        Singleton.__has_init = True

s1 = Singleton()
print(s1)

s2 = Singleton()
print(s2)